/*******************************************
  Jose Andres Lara Vecino

  Author       : $$Author: cainlara@gmail.com $$
  Last CheckIn : $$Date: 2012-10-29 19:04:52 +0000 (Mon, 29 Oct 2012) $$
  Revision     : $$Revision: 108 $$
*******************************************/

package core;

/**
 * Enumerado de tipo Actor.
 * 
 */
public enum ETipoNodo {
    SUITE {
        @Override
        public int getId() {
            return 0;
        }
        
        @Override
        public String getName() {
            return "Suite";
        }
    },
    
    TEST_CASE {
        @Override
        public int getId() {
            return 1;
        }
        
        @Override
        public String getName() {
            return "TestCase";
        }
    }
    ;
    
    public ETipoNodo[] getValues() {
        return ETipoNodo.values();
    }
    
    public static ETipoNodo getValor(int id) {
        for(ETipoNodo e : ETipoNodo.values()) {
            if(e.getId() == id) {
                return e;
            }
        }
        
        return null;
    }
    
    public static ETipoNodo getValorNombre(String nombre) {
        for(ETipoNodo e : ETipoNodo.values()) {
            if(e.getName().equals(nombre)) {
                return e;
            }
        }
        
        return null;
      }
    
    public abstract int getId();
    public abstract String getName();
}
